import { defineConfig } from 'vite';
import tsconfigPaths from 'vite-tsconfig-paths';
import semi from 'vite-plugin-semi-theme';
import react from '@vitejs/plugin-react';
import { resolve } from 'path'
// https://vitejs.dev/config/
export default defineConfig({
  plugins: [
    react(),
    semi({
      // theme: "@semi-bot/semi-theme-yours",
      options: {
        variables: {
          '$spacing-card-padding': '$spacing-base-tight',
        },
      },
    }),
    tsconfigPaths(),
  ],
  resolve: {
    // 配置路径别名
    alias: {
      "@/": resolve(__dirname, 'src'), // 路径别名
  },
  },
  server: {
    proxy: {
      '/mrktcoop': {
        target: 'http://mrktcoop-qas.dcedev-alb.shanghai-electric.com',
        // secure: false,
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/mrktcoop/, ''),
        // ws: true
      },
    },
  },
});
